﻿package Base.Tools
{
	import flash.utils.ByteArray;
	import flash.net.LocalConnection;
	
	/**
	 * ...
	 * @author fox
	 */
	
	public class BaseTools
	{
		// object copy
		public static function Clone( source:Object ):Object
		{
			var copier:ByteArray = new ByteArray();
			copier.writeObject( source );
			copier.position = 0;
			return( copier.readObject() );
		}
		
		// gc
		public static function GC():void
		{
			try
			{
				new LocalConnection().connect( "fox" );
				new LocalConnection().connect( "fox" );
			}
			catch( error:* )
			{
			}
		}
		
	}
}